import * as  fs from 'fs';
import * as  path from 'path';
import { DataBaseConnection } from "../../database/database_mysql";

const config: IDatabaseConfig = JSON.parse(fs.readFileSync(path.join(__dirname, '../../database/config.json')).toString());

export class BaseLogic {
    protected requestConnect(database: string) {
        return new DataBaseConnection({
            location: config[database].location,
            username: config[database].username,
            password: config[database].password,
            database: config[database].database
        });
    }
}